<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ez="http://java.sun.com/jsf/composite/ezcomp"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions"
      xmlns:f="http://java.sun.com/jsf/core" >
    <h:head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <meta charset="utf-8" />
        <title>Ruhunu Hospital Form</title>
        <meta name="generator" content="Bootply" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
        <link href="resources/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
        <!--[if lt IE 9]>
                                <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
                        <![endif]-->
        <link href="resources/css/styles.css" rel="stylesheet" type="text/css" />
        <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script> 
        <script src="resources/js/bootstrap.min.js"></script>
    </h:head>
    <h:body >
        <!--login modal-->
        <div id="loginModal" class="modal show" tabindex="-1" role="dialog" aria-hidden="true" style="overflow: auto;">
            <div class="container-fluid" >
                <div class="inner_wrap">
                    <div class="form-group-lg">
                        <h:form >
                            <h:outputStylesheet library="css" name="maincss.css" />
                            <div id="background" class="row nonPrintBlock" >
                                <div id="page">
                                    <!--                                    <div id="header" class="nonPrintBlock">
                                    
                                                                            <span id="infos">
                                                                                <h:commandLink value="Staff Login" action="index" ></h:commandLink>
                                                                                |
                                                                                <h:commandLink value="Administrator" action="index" ></h:commandLink>
                                                                            </span>
                                                                            <h:commandLink action="index" ></h:commandLink>
                                                                            <a href="#" id="logo"></a>
                                    
                                                                             /#logo 
                                    
                                                                        </div>-->
                                    <!-- /#header -->
                                    <div id="contents">
                                        <div id="main" >

                                            <div >

                                                <div class="nonPrintBlock" >
                                                    <div class="nonPrintBlock" >

                                                        <h:commandButton  styleClass="btn btn-success " style="margin-left: 20px; height: 30px;" value="Print" 
                                                                          onclick="window.print();" />
                                                        <h:commandButton  styleClass="btn btn-success" style="margin-left: 20px; height: 30px;"  id="cmdViewReport" 
                                                                          value="Back" 
                                                                          action="reports_list_new">
                                                        </h:commandButton>
                                                    </div>
                                                </div>


                                                <h:panelGroup  id="divPrint" >
                                                    <div class="modal-header">
                                                        <!--<h1 class="text-center">#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.department.institution.name}</h1>-->
                                                        <h1 class="text-center">Ruhunu Hospital (PVT) LTD</h1>
                                                    </div>
                                                    <div>
                                                        <h:panelGroup rendered="#{patientReportController.currentPatientReport.item.reportType ne 'Microbiology'}"  >
                                                            <div id="divReport"  style="min-width:800px;min-height: 1100px;position: relative; font-size: 120%;">
                                                                <p:graphicImage  library="image/lab" name="web_1.jpg" 
                                                                                style="height: 210px; width: 100%;" ></p:graphicImage>


                                                                <ui:repeat value="#{commonReportItemController.items}" var="myCli" >
                                                                    <div style="#{myCli.cssStyle}; position:absolute;">
                                                                        <h:outputText rendered="#{myCli.ixItemType eq 'Label' and myCli.retired ne true }"  value="#{myCli.name}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'PatientName' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.patient.person.nameWithTitle}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'PatientAge' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.patient.age}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'PatientSex' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.patient.person.sex}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'InvestigationName' and  myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.investigation.name}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'Speciman' and  myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.investigation.sample.name}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'SampledTime' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.sampledAt}" style="color: #{myCli.cssColor}" escape="false" >

                                                                            <f:convertDateTime pattern="hh mm ss a"/>
                                                                        </h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'CollectingCenter' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.collectingCentre}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'BilledDate' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.createdAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                                            <f:convertDateTime pattern="dd MMM yyyy"></f:convertDateTime>
                                                                        </h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'BilledTime' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.createdAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                                            <f:convertDateTime pattern="hh mm ss a"/>
                                                                        </h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'SampledDate' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.sampledAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                                            <f:convertDateTime pattern="dd MMM yyyy"></f:convertDateTime>
                                                                        </h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'BillNo' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.insId}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>

                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'ReportedDate' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.createdAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                                            <f:convertDateTime pattern="dd MMM yyyy"></f:convertDateTime>
                                                                        </h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'ReportedTime' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.createdAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                                            <f:convertDateTime pattern="hh mm ss a"/>
                                                                        </h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'ReferringDoctor' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.referredBy.person.nameWithTitle}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'ReferringInstitution' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.referredByInstitution.name}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>

                                                                        <p:graphicImage rendered="#{myCli.reportItemType eq 'AutherizedSignature' and myCli.retired eq false and patientReportController.currentPatientReport.approveUser.staff.id ne null }"    value="#{staffImageController.signatureById}" style="width: #{myCli.cssWidth}; max-height: 50px!important;"  >
                                                                            <f:param name="id" value="#{patientReportController.currentPatientReport.approveUser.staff.id}" />
                                                                        </p:graphicImage>

                                                                    </div>
                                                                </ui:repeat>


                                                                <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" var="prv" >

                                                                    <div style="#{prv.investigationItem.cssStyle}; position:absolute;">
                                                                        <h:outputLabel value="#{prv.lobValue}" rendered="#{prv.investigationItem.ixItemType eq 'Value' and prv.investigationItem.ixItemValueType eq 'Memo' and prv.investigationItem.retired eq false}"  escape="false" />
                                                                    </div>
                                                                </ui:repeat>

                                                                <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" var="prv" >
                                                                    <div style="#{prv.investigationItem.cssStyle}; position:absolute;">
                                                                        <h:outputLabel value="#{prv.strValue}" rendered="#{prv.investigationItem.ixItemType eq 'Value' and prv.investigationItem.ixItemValueType eq 'Varchar'}" escape="false" />
                                                                    </div>
                                                                </ui:repeat>

                                                                <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" var="prv" >
                                                                    <div style="#{prv.investigationItem.cssStyle}; position:absolute;">
                                                                        <h:outputLabel value="#{prv.doubleValue}"  rendered="#{prv.investigationItem.ixItemType eq 'Value' and prv.investigationItem.ixItemValueType eq 'Double' and prv.investigationItem.retired eq false}"   escape="false" />
                                                                    </div>
                                                                </ui:repeat>


                                                                <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" var="prv" >
                                                                    <div style="#{prv.investigationItem.cssStyle}; position:absolute;">
                                                                        <h:outputLabel value="#{prv.strValue}" rendered="#{prv.investigationItem.ixItemType eq 'DynamicLabel'}" escape="false" />
                                                                    </div>
                                                                </ui:repeat>

                                                                <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" var="prv" >
                                                                    <div style="#{prv.investigationItem.cssStyle}; position:absolute;">
                                                                        <h:outputLabel value="#{prv.strValue}" rendered="#{prv.investigationItem.ixItemType eq 'Flag'}" escape="false" />
                                                                    </div>
                                                                </ui:repeat>

                                                                <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" var="prv" >
                                                                    <div style="#{prv.investigationItem.cssStyle}; position:absolute;">
                                                                        <h:outputLabel value="#{prv.doubleValue}" rendered="#{prv.investigationItem.ixItemType eq 'Calculation' }" escape="false" >
                                                                            <f:convertNumber pattern="0.0" />
                                                                        </h:outputLabel>
                                                                    </div>
                                                                </ui:repeat>

                                                                <ui:repeat value="#{patientReportController.currentPatientReport.item.reportItems}" var="myIi" >
                                                                    <div style="#{myIi.cssStyle}; position:absolute;">
                                                                        <h:outputText rendered="#{myIi.retired ne true and myIi.ixItemType eq 'Label' }" value="#{myIi.htmltext}" style="color: #{myIi.cssColor}" escape="false" ></h:outputText>
                                                                    </div>
                                                                </ui:repeat>

                                                                <p:graphicImage  library="image/lab" name="web_footer.jpg" 
                                                                                    style="height: 160px; width: 100%;position: absolute;bottom: 0px!important;" ></p:graphicImage>
                                                                                    
                                                            </div>
                                                        </h:panelGroup>


                                                        <h:panelGroup rendered="#{patientReportController.currentPatientReport.item.reportType eq 'Microbiology'}"  >
                                                            <div id="divReportM"  style="min-width:800px;min-height: 1100px; position: relative; font-size: 150%;">
                                                                <p:graphicImage  library="image/lab" name="web_1.jpg" 
                                                                                style="height: 210px; width: 100%;" ></p:graphicImage>
                                                                <ui:repeat value="#{commonReportItemController.items}" var="myCli" >
                                                                    <div style="#{myCli.cssStyle}; position:absolute;">
                                                                        <h:outputText rendered="#{myCli.ixItemType eq 'Label' and myCli.retired ne true }"  value="#{myCli.name}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'PatientName' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.patient.person.nameWithTitle}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'PatientAge' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.patient.age}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'PatientSex' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.patient.person.sex}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'InvestigationName' and  myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.investigation.name}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'Speciman' and  myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.investigation.sample.name}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'SampledTime' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.sampledAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                                            <f:convertDateTime pattern="hh mm ss a"/>
                                                                        </h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'BilledDate' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.createdAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                                            <f:convertDateTime pattern="dd MMMM yyyy"></f:convertDateTime>
                                                                        </h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'BilledTime' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.createdAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                                            <f:convertDateTime pattern="hh mm ss a"/>
                                                                        </h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'SampledDate' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.sampledAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                                            <f:convertDateTime pattern="dd MMMM yyyy"></f:convertDateTime>
                                                                        </h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'BillNo' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.insId}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>

                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'ReportedDate' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.dataEntryAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                                            <f:convertDateTime pattern="dd MMMM yyyy"></f:convertDateTime>
                                                                        </h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'ReportedTime' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.dataEntryAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                                            <f:convertDateTime pattern="hh mm ss a"/>
                                                                        </h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'ReferringDoctor' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.referredBy.person.nameWithTitle}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                                                        <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'ReferringInstitution' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.referredByInstitution.name}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>

                                                                        <h:panelGroup rendered="#{patientReportController.currentPatientReport.approveUser.staff.baImage ne null}">
                                                                            <p:graphicImage rendered="#{myCli.reportItemType eq 'AutherizedSignature' and myCli.retired eq false }"    value="#{staffImageController.signatureById}" style="width: #{myCli.cssWidth}; max-height: 50px!important;"  >
                                                                                <f:param name="id" value="#{patientReportController.currentPatientReport.approveUser.staff.id}" />
                                                                            </p:graphicImage>


                                                                        </h:panelGroup>

                                                                    </div>
                                                                </ui:repeat>



                                                                <table id="micro" style="position: absolute; top: 35%; left:10%; font-size: 14px!important;" >
                                                                    <tr>
                                                                        <td>
                                                                            <h:outputLabel value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                                           #{patientReportController.currentPatientReport.patientInvestigation.investigation.printName}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" 
                                                                                           style="font-weight: bold;font-size: 16px!important; margin: 5px;padding: 5px; border: solid black 1px;"/>
                                                                        </td>
                                                                    </tr>
                                                                    <tr><td><h:outputLabel/></td></tr>
                                                                    <tr><td><h:outputLabel/></td></tr>
                                                                    <tr><td><h:outputLabel/></td></tr>
                                                                    <tr>
                                                                        <td id="micromemos">
                                                                            <table  style="width: 100%!important;">                 
                                                                                <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" var="prv" >

                                                                                    <h:panelGroup rendered="#{prv.investigationItem.ixItemType eq 'Value' and prv.investigationItem.ixItemValueType eq 'Memo' and prv.investigationItem.retired eq false and prv.lobValue ne '' and prv.lobValue ne null and prv.investigationItem.riTop  lt 50 }" >
                                                                                        <tr >
                                                                                            <td style="min-width: 250px; vertical-align: top;">
                                                                                                <br/>
                                                                                                <h:outputLabel value="#{prv.investigationItem.name}"  escape="false"  />
                                                                                            </td>
                                                                                            <td>
                                                                                                <h:outputLabel value="#{prv.lobValue}"  escape="false" style="white-space: pre-wrap;" />
                                                                                            </td>
                                                                                        </tr>
                                                                                    </h:panelGroup>

                                                                                    <h:panelGroup rendered="#{prv.investigationItem.ixItemType eq 'DynamicLabel' and prv.investigationItem.retired eq false and prv.investigationItem.riTop  lt 50 }" >
                                                                                        <tr >
                                                                                            <td style="min-width: 250px;">
                                                                                                <h:outputLabel value="#{prv.investigationItem.name}"  escape="false"  />
                                                                                            </td>
                                                                                            <td>

                                                                                            </td>
                                                                                        </tr>
                                                                                    </h:panelGroup>



                                                                                </ui:repeat>
                                                                            </table>
                                                                        </td>
                                                                    </tr>
                                                                    <br/><br/>




                                                                    <tr>
                                                                        <td id="micLabelsBeforeAbst">

                                                                            <ui:repeat value="#{patientReportController.currentPatientReport.item.reportItems}" var="myMicIi" >
                                                                                <div style="#{myMicIi.cssStyle}; left: #{prvl.cssLeft};">
                                                                                    <h:outputText rendered="#{myMicIi.retired ne true and myMicIi.ixItemType eq 'List' }" 
                                                                                                  value="#{myMicIi.name}" style="color: #{myMicIi.cssColor}" escape="false" ></h:outputText>
                                                                                </div>
                                                                            </ui:repeat>


                                                                        </td>
                                                                    </tr>

                                                                    <tr>
                                                                        <td id="ablist">
                                                                            <table>
                                                                                <tr>
                                                                                    <td colspan="2"  >
                                                                                        <h:outputLabel 
                                                                                            value="Antibiotic Sensitivity Test"
                                                                                            rendered="#{patientReportController.currentPatientReport.transHasAbst}"
                                                                                            style="font-size: 120%!important;font-weight: bold;"></h:outputLabel>
                                                                                    </td>
                                                                                </tr>
                                                                                <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" 
                                                                                            var="prv" >
                                                                                    <h:panelGroup 
                                                                                        rendered="#{prv.investigationItem.ixItemType eq 'Value' and prv.investigationItem.ixItemValueType eq 'Varchar' and prv.investigationItem.retired eq false and prv.strValue ne '' and prv.strValue ne null  }" >
                                                                                        <tr>
                                                                                            <td style="min-width: 250px;">
                                                                                                <h:outputLabel value="#{prv.investigationItem.name}"  escape="false" />
                                                                                            </td>
                                                                                            <td>

                                                                                                <h:outputLabel value="#{prv.strValue}" escape="false" />
                                                                                            </td>
                                                                                        </tr>
                                                                                    </h:panelGroup>
                                                                                </ui:repeat>
                                                                            </table>

                                                                        </td>
                                                                    </tr>
                                                                    <br/><br/>
                                                                    <tr>
                                                                        <td id="miccomments">
                                                                            <table>
                                                                                <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" var="prv" >
                                                                                    <h:panelGroup rendered="#{prv.investigationItem.ixItemType eq 'Value' and prv.investigationItem.ixItemValueType eq 'Memo' and prv.investigationItem.retired eq false and prv.lobValue ne '' and prv.lobValue ne null and prv.investigationItem.riTop gt 50 }" >

                                                                                        <tr>
                                                                                            <td style="min-width: 250px;padding: 5px;padding-left: 1px; padding-right: 1px;">
                                                                                                <h:outputLabel value="#{prv.investigationItem.name}"  escape="false" />
                                                                                            </td>
                                                                                            <td>
                                                                                                <h:outputLabel value="#{prv.lobValue}"  escape="false" />
                                                                                            </td>
                                                                                        </tr>

                                                                                    </h:panelGroup>

                                                                                </ui:repeat>
                                                                            </table>

                                                                        </td>
                                                                    </tr>

                                                                </table>

                                                                <p:graphicImage  library="image/lab" name="web_footer.jpg" 
                                                                                    style="height: 160px; width: 100%;position: absolute;bottom: 0px!important;" ></p:graphicImage>
                                                            </div>
                                                        </h:panelGroup>
                                                    </div>

                                                </h:panelGroup>


                                            </div>


                                        </div>
                                    </div>
                                    
                                </div>
                                <!-- /#page -->
                            </div>

                        </h:form>
                    </div>
                </div>
            </div>
        </div>  
        <h:form>
            <div class="printBlock">

                <h:panelGroup>

                    <div class="labBillPrintPanel" >

                        <div>
                            <h:panelGroup rendered="#{patientReportController.currentPatientReport.item.reportType ne 'Microbiology'}"  >
                                <div id="divReport"  style="min-width:800px;min-height: 1100px; position: relative; font-size: 120%;">
                                    <p:graphicImage  library="image/lab" name="web_1.jpg" 
                                                    style="height: 210px; width: 100%;" ></p:graphicImage>


                                    <ui:repeat value="#{commonReportItemController.items}" var="myCli" >
                                        <div style="#{myCli.cssStyle}; position:absolute;">
                                            <h:outputText rendered="#{myCli.ixItemType eq 'Label' and myCli.retired ne true }"  value="#{myCli.name}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'PatientName' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.patient.person.nameWithTitle}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'PatientAge' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.patient.age}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'PatientSex' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.patient.person.sex}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'InvestigationName' and  myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.investigation.name}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'Speciman' and  myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.investigation.sample.name}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'SampledTime' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.sampledAt}" style="color: #{myCli.cssColor}" escape="false" >

                                                <f:convertDateTime pattern="hh mm ss a"/>
                                            </h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'CollectingCenter' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.collectingCentre}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'BilledDate' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.createdAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                <f:convertDateTime pattern="dd MMM yyyy"></f:convertDateTime>
                                            </h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'BilledTime' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.createdAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                <f:convertDateTime pattern="hh mm ss a"/>
                                            </h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'SampledDate' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.sampledAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                <f:convertDateTime pattern="dd MMM yyyy"></f:convertDateTime>
                                            </h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'BillNo' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.insId}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>

                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'ReportedDate' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.createdAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                <f:convertDateTime pattern="dd MMM yyyy"></f:convertDateTime>
                                            </h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'ReportedTime' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.createdAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                <f:convertDateTime pattern="hh mm ss a"/>
                                            </h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'ReferringDoctor' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.referredBy.person.nameWithTitle}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'ReferringInstitution' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.referredByInstitution.name}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>

                                            <p:graphicImage rendered="#{myCli.reportItemType eq 'AutherizedSignature' and myCli.retired eq false and patientReportController.currentPatientReport.approveUser.staff.id ne null }"    value="#{staffImageController.signatureById}" style="width: #{myCli.cssWidth}; max-height: 50px!important;"  >
                                                <f:param name="id" value="#{patientReportController.currentPatientReport.approveUser.staff.id}" />
                                            </p:graphicImage>

                                        </div>
                                    </ui:repeat>


                                    <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" var="prv" >

                                        <div style="#{prv.investigationItem.cssStyle}; position:absolute;">
                                            <h:outputLabel value="#{prv.lobValue}" rendered="#{prv.investigationItem.ixItemType eq 'Value' and prv.investigationItem.ixItemValueType eq 'Memo' and prv.investigationItem.retired eq false}"  escape="false" />
                                        </div>
                                    </ui:repeat>

                                    <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" var="prv" >
                                        <div style="#{prv.investigationItem.cssStyle}; position:absolute;">
                                            <h:outputLabel value="#{prv.strValue}" rendered="#{prv.investigationItem.ixItemType eq 'Value' and prv.investigationItem.ixItemValueType eq 'Varchar'}" escape="false" />
                                        </div>
                                    </ui:repeat>

                                    <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" var="prv" >
                                        <div style="#{prv.investigationItem.cssStyle}; position:absolute;">
                                            <h:outputLabel value="#{prv.doubleValue}"  rendered="#{prv.investigationItem.ixItemType eq 'Value' and prv.investigationItem.ixItemValueType eq 'Double' and prv.investigationItem.retired eq false}"   escape="false" />
                                        </div>
                                    </ui:repeat>


                                    <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" var="prv" >
                                        <div style="#{prv.investigationItem.cssStyle}; position:absolute;">
                                            <h:outputLabel value="#{prv.strValue}" rendered="#{prv.investigationItem.ixItemType eq 'DynamicLabel'}" escape="false" />
                                        </div>
                                    </ui:repeat>

                                    <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" var="prv" >
                                        <div style="#{prv.investigationItem.cssStyle}; position:absolute;">
                                            <h:outputLabel value="#{prv.strValue}" rendered="#{prv.investigationItem.ixItemType eq 'Flag'}" escape="false" />
                                        </div>
                                    </ui:repeat>

                                    <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" var="prv" >
                                        <div style="#{prv.investigationItem.cssStyle}; position:absolute;">
                                            <h:outputLabel value="#{prv.doubleValue}" rendered="#{prv.investigationItem.ixItemType eq 'Calculation' }" escape="false" >
                                                <f:convertNumber pattern="0.0" />
                                            </h:outputLabel>
                                        </div>
                                    </ui:repeat>

                                    <ui:repeat value="#{patientReportController.currentPatientReport.item.reportItems}" var="myIi" >
                                        <div style="#{myIi.cssStyle}; position:absolute;">
                                            <h:outputText rendered="#{myIi.retired ne true and myIi.ixItemType eq 'Label' }" value="#{myIi.htmltext}" style="color: #{myIi.cssColor}" escape="false" ></h:outputText>
                                        </div>
                                    </ui:repeat>

                                    <p:graphicImage  library="image/lab" name="web_footer.jpg" 
                                                                                    style="height: 160px; width: 100%;position: absolute;bottom: 0px!important;z-index: -1;" ></p:graphicImage>
                                </div>
                            </h:panelGroup>


                            <h:panelGroup rendered="#{patientReportController.currentPatientReport.item.reportType eq 'Microbiology'}"  >
                                <div id="divReportM"  style="min-width:800px;min-height: 1100px; position: relative; font-size: 150%;">
                                    <p:graphicImage  library="image/lab" name="web_1.jpg" 
                                                    style="height: 210px; width: 100%;" ></p:graphicImage>
                                    <ui:repeat value="#{commonReportItemController.items}" var="myCli" >
                                        <div style="#{myCli.cssStyle}; position:absolute;">
                                            <h:outputText rendered="#{myCli.ixItemType eq 'Label' and myCli.retired ne true }"  value="#{myCli.name}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'PatientName' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.patient.person.nameWithTitle}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'PatientAge' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.patient.age}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'PatientSex' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.patient.person.sex}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'InvestigationName' and  myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.investigation.name}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'Speciman' and  myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.investigation.sample.name}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'SampledTime' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.sampledAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                <f:convertDateTime pattern="hh mm ss a"/>
                                            </h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'BilledDate' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.createdAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                <f:convertDateTime pattern="dd MMMM yyyy"></f:convertDateTime>
                                            </h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'BilledTime' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.createdAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                <f:convertDateTime pattern="hh mm ss a"/>
                                            </h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'SampledDate' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.sampledAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                <f:convertDateTime pattern="dd MMMM yyyy"></f:convertDateTime>
                                            </h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'BillNo' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.insId}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>

                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'ReportedDate' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.dataEntryAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                <f:convertDateTime pattern="dd MMMM yyyy"></f:convertDateTime>
                                            </h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'ReportedTime' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.dataEntryAt}" style="color: #{myCli.cssColor}" escape="false" >
                                                <f:convertDateTime pattern="hh mm ss a"/>
                                            </h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'ReferringDoctor' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.referredBy.person.nameWithTitle}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>
                                            <h:outputText rendered="#{myCli.ixItemType ne 'Label' and myCli.reportItemType eq 'ReferringInstitution' and myCli.retired eq false }"  value="#{patientReportController.currentPatientReport.patientInvestigation.billItem.bill.referredByInstitution.name}" style="color: #{myCli.cssColor}" escape="false" ></h:outputText>

                                            <h:panelGroup rendered="#{patientReportController.currentPatientReport.approveUser.staff.baImage ne null}">
                                                <p:graphicImage rendered="#{myCli.reportItemType eq 'AutherizedSignature' and myCli.retired eq false }"    value="#{staffImageController.signatureById}" style="width: #{myCli.cssWidth}; max-height: 50px!important;"  >
                                                    <f:param name="id" value="#{patientReportController.currentPatientReport.approveUser.staff.id}" />
                                                </p:graphicImage>


                                            </h:panelGroup>

                                        </div>
                                    </ui:repeat>



                                    <table id="micro" style="position: absolute; top: 35%; left:10%; font-size: 14px!important;" >
                                        <tr>
                                            <td>
                                                <h:outputLabel value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                               #{patientReportController.currentPatientReport.patientInvestigation.investigation.printName}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" 
                                                               style="font-weight: bold;font-size: 16px!important; margin: 5px;padding: 5px; border: solid black 1px;"/>
                                            </td>
                                        </tr>
                                        <tr><td><h:outputLabel/></td></tr>
                                        <tr><td><h:outputLabel/></td></tr>
                                        <tr><td><h:outputLabel/></td></tr>
                                        <tr>
                                            <td id="micromemos">
                                                <table  style="width: 100%!important;">                 
                                                    <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" var="prv" >

                                                        <h:panelGroup rendered="#{prv.investigationItem.ixItemType eq 'Value' and prv.investigationItem.ixItemValueType eq 'Memo' and prv.investigationItem.retired eq false and prv.lobValue ne '' and prv.lobValue ne null and prv.investigationItem.riTop  lt 50 }" >
                                                            <tr >
                                                                <td style="min-width: 250px; vertical-align: top;">
                                                                    <br/>
                                                                    <h:outputLabel value="#{prv.investigationItem.name}"  escape="false"  />
                                                                </td>
                                                                <td>
                                                                    <h:outputLabel value="#{prv.lobValue}"  escape="false" style="white-space: pre-wrap;" />
                                                                </td>
                                                            </tr>
                                                        </h:panelGroup>

                                                        <h:panelGroup rendered="#{prv.investigationItem.ixItemType eq 'DynamicLabel' and prv.investigationItem.retired eq false and prv.investigationItem.riTop  lt 50 }" >
                                                            <tr >
                                                                <td style="min-width: 250px;">
                                                                    <h:outputLabel value="#{prv.investigationItem.name}"  escape="false"  />
                                                                </td>
                                                                <td>

                                                                </td>
                                                            </tr>
                                                        </h:panelGroup>



                                                    </ui:repeat>
                                                </table>
                                            </td>
                                        </tr>
                                        <br/><br/>




                                        <tr>
                                            <td id="micLabelsBeforeAbst">

                                                <ui:repeat value="#{patientReportController.currentPatientReport.item.reportItems}" var="myMicIi" >
                                                    <div style="#{myMicIi.cssStyle}; left: #{prvl.cssLeft};">
                                                        <h:outputText rendered="#{myMicIi.retired ne true and myMicIi.ixItemType eq 'List' }" 
                                                                      value="#{myMicIi.name}" style="color: #{myMicIi.cssColor}" escape="false" ></h:outputText>
                                                    </div>
                                                </ui:repeat>


                                            </td>
                                        </tr>

                                        <tr>
                                            <td id="ablist">
                                                <table>
                                                    <tr>
                                                        <td colspan="2"  >
                                                            <h:outputLabel 
                                                                value="Antibiotic Sensitivity Test"
                                                                rendered="#{patientReportController.currentPatientReport.transHasAbst}"
                                                                style="font-size: 120%!important;font-weight: bold;"></h:outputLabel>
                                                        </td>
                                                    </tr>
                                                    <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" 
                                                                var="prv" >
                                                        <h:panelGroup 
                                                            rendered="#{prv.investigationItem.ixItemType eq 'Value' and prv.investigationItem.ixItemValueType eq 'Varchar' and prv.investigationItem.retired eq false and prv.strValue ne '' and prv.strValue ne null  }" >
                                                            <tr>
                                                                <td style="min-width: 250px;">
                                                                    <h:outputLabel value="#{prv.investigationItem.name}"  escape="false" />
                                                                </td>
                                                                <td>

                                                                    <h:outputLabel value="#{prv.strValue}" escape="false" />
                                                                </td>
                                                            </tr>
                                                        </h:panelGroup>
                                                    </ui:repeat>
                                                </table>

                                            </td>
                                        </tr>
                                        <br/><br/>
                                        <tr>
                                            <td id="miccomments">
                                                <table>
                                                    <ui:repeat  value="#{patientReportController.currentPatientReport.patientReportItemValues}" var="prv" >
                                                        <h:panelGroup rendered="#{prv.investigationItem.ixItemType eq 'Value' and prv.investigationItem.ixItemValueType eq 'Memo' and prv.investigationItem.retired eq false and prv.lobValue ne '' and prv.lobValue ne null and prv.investigationItem.riTop gt 50 }" >

                                                            <tr>
                                                                <td style="min-width: 250px;padding: 5px;padding-left: 1px; padding-right: 1px;">
                                                                    <h:outputLabel value="#{prv.investigationItem.name}"  escape="false" />
                                                                </td>
                                                                <td>
                                                                    <h:outputLabel value="#{prv.lobValue}"  escape="false" />
                                                                </td>
                                                            </tr>

                                                        </h:panelGroup>

                                                    </ui:repeat>
                                                </table>

                                            </td>
                                        </tr>

                                    </table>

                                    <p:graphicImage  library="image/lab" name="web_footer.jpg" 
                                                                                    style="height: 160px; width: 100%;position: absolute;bottom: 0px!important;z-index: -1;" ></p:graphicImage>
                                </div>
                            </h:panelGroup>
                        </div>


                    </div>

                </h:panelGroup>


            </div>
        </h:form>
        <!-- script references --> 

    </h:body>
</html>